package com.cn.kabalifeuser.view.dialogView;//package com.cn.automobileservice.view.dialogView;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.cn.kabalifeuser.R;
import com.cn.kabalifeuser.utils.X5WebView;


/**
 * Created by 晓林 on 2019/10/18.
 * function: 首页
 */
public class AgeDialog extends Dialog {
    protected Context mContext;

    protected WindowManager.LayoutParams mLayoutParams;

    X5WebView webView;
    TextView tv_btn_y,tv_btn_n;

    public X5WebView getWebView() {
        return webView;
    }


    public TextView getTv_btn_y() {
        return tv_btn_y;
    }

    public TextView getTv_btn_n() {
        return tv_btn_n;
    }

    public AgeDialog(Context context) {
        super(context);
        initView(context);
    }

    public AgeDialog(Activity context) {
        super(context);
        initView(context);
    }


    private void initView(Context context) {
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        this.getWindow().setBackgroundDrawableResource(R.drawable.transparent_bg);
        mContext = context;
        Window window = this.getWindow();
        mLayoutParams = window.getAttributes();
        mLayoutParams.alpha = 1f;
        window.setAttributes(mLayoutParams);
        if (mLayoutParams != null) {
            mLayoutParams.height = android.view.ViewGroup.LayoutParams.MATCH_PARENT;
            mLayoutParams.gravity = Gravity.CENTER;
        }
        View dialogView = LayoutInflater.from(getContext()).inflate(R.layout.dialog_age, null);
        webView = dialogView.findViewById(R.id.webView);
        tv_btn_n = dialogView.findViewById(R.id.tv_btn_n);
        tv_btn_y = dialogView.findViewById(R.id.tv_btn_y);
        setContentView(dialogView);

    }
}
